import LoadingMain from './LoadingMainBox'
import ReactDOM from 'react-dom/client'

const loading = (message: string) => {
  const node = document.createDocumentFragment()
  ReactDOM.createRoot(node).render(LoadingMain({ message }))
  document.body.appendChild(node)
  return () => {
    document.body.removeChild(node)
  }
}
export default loading
